#!/bin/sh

set -e

. /etc/default/openmediavault
. /usr/share/openmediavault/scripts/helper-functions

if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then

	# Check for XML config
	if [ "$1" = "purge" ]; then
		if omv_config_exists "//services/virtualbox"; then
			xmlstarlet ed -P -L -d "//services/virtualbox" ${OMV_CONFIG_FILE}
		fi	
	fi
	
fi

exit 0
